package com.springstart;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

public class Student implements BeanNameAware, ApplicationContextAware{
	
	@Value("106")
	private int id;
	
	private String name;
	private String school;
	private String beanName;
	private ApplicationContext context;
	
	@Resource(name="colorList")
	private List<String> clist;
	
	public List<String> getClist() {
		return clist;
	}

	public void setClist(List<String> clist) {
		this.clist = clist;
	}

	@Autowired
	public Student(@Value("xiangming") String school) {
		this.school = school;
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		this.school = school;
	}

	@Override
	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	public String getBeanName() {
		return beanName;
	}

	@Override
	public void setApplicationContext(ApplicationContext context)
			throws BeansException {
		context = this.context;
	}

	public ApplicationContext getContext() {
		return context;
	}

	public void setContext(ApplicationContext context) {
		System.out.println("Dd"+context);
		this.context = context;
	}

	

	
	
	
}
